<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<p>
	<html:link href="#" onclick="sendRequest('newsAction.do', 'GET', 'method=list')">
		<bean:message key="label.link.News"/> 
	</html:link> &gt;&gt;
	<bean:message key="label.addnews.title"/> <br/>
</p>
<html:form styleId="add-news-form" method="POST" action="/newsAction.do" onsubmit="return validateNewsForm(clicked);">
	<p class="news-label"> 
		<bean:message key="label.addnews.newstitle" />	
	</p>
	<p class="news-content">
		<html:text styleClass="add-news-content" styleId="add-news-title" property="news.title" />
	</p>
	<p class="news-label">
		<bean:message key="label.addnews.newsdate" />	
	</p>
	<c:set var="pattern">
		<bean:message key="format.date" />
	</c:set>
	<c:set target="${newsForm}" property="dateString">
		<fmt:formatDate value="${newsForm.news.date}" pattern="${pattern}" />
	</c:set>
	<p class="news-content">
		<html:text styleClass="add-news-content" styleId="add-news-date" property="dateString" />
	</p>
	<p class="news-label">
		<bean:message key="label.addnews.brief"/>
	</p>
	<p class="news-content">
		<html:textarea styleClass="add-news-content" styleId="news-brief" rows="6"  property="news.brief" />
	</p>
	<p class="news-label">
		<bean:message key="label.addnews.content"/>
	</p>
	<p class="news-content">
		<html:textarea styleClass="add-news-content" styleId="news-content" rows="12" property="news.content" />
	</p>
	<p id="add-news-buttons">
		<button type="button" class="add-news-button" name="method" value="save" onclick="saveNews()">
			<bean:message key="label.addnews.button.save"/>
		</button>
		<button type="button" class="add-news-button" name="method" value="cancel" onclick="sendRequest('newsAction.do', 'GET', 'method=cancel')">
			<bean:message key="label.addnews.button.cancel" />
		</button>
	</p>
</html:form>